package PPJ;

public class Zad27 {

	public static void main(String[] args) {

		Point p = new Point(1,2);
		p.setX(1);
		p.setY(2);
		p.show();
		System.out.println(p.distance(p));		
		System.out.println(p.parallel(p));
	}

}

  class Point {

	int x = 0;
	int y = 0;
	
	int a = 0;
	int b = 0;

	Point() {
		 a = 0;
		 b = 0;
	}

	Point(int a) {
		x=a;
	}

	Point(int a, int b) {
		x=a;
		y=b;
	}

	public void setX(int a){
		x=a;
	}
	
	public void setY(int b){
		y=b;
	}
	
	public void show(){
		System.out.println("("+x+","+y+")");
	}
	
	public double distance (Point p){
	    double wynik = Math.sqrt(Math.pow((x-a), 2)+Math.pow((y-b), 2)) ;
		return wynik;
	}
	
	public boolean parallel (Point p){	    
		boolean wynik = false;
		if((x-a)==0 || (y-b)==0)
		wynik = true;
		return wynik;
	}
	
	
	
	
}
